<script>
  import { h } from 'vue'
  import { check } from '@/utils/auth.js'
  export default {
    props: {
      permissions: {
        type: Array,
        required: true
      }
    },

    setup(props, context) {
      return check(props.permissions) 
        ? context.slots.default
        : () => h('template')
    }
  }
</script>